package com.example.demo.sort;

/**
 * 冒泡排序
 *
 * @author wangadmin
 */
public class BubbleSort {

    public static void main(String[] args) {
        int[] sortArray = SortContent.sortArray;
        for (int i = 0; i < sortArray.length; i++) {
            for (int j = 0; j < sortArray.length - i - 1; j++) {
                int currentVal = sortArray[j];
                int currentNextVal = sortArray[j + 1];
                if (currentNextVal < currentVal) {
                    sortArray[j] = currentNextVal;
                    sortArray[j + 1] = currentVal;
                }

            }

        }
    }


}
